<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Team Bonus Summary</title>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<script language="javascript"> 
$(function() {
	$( "#date" ).datepicker({ dateFormat: "yy-mm-dd",firstDay: 1 });
});	

function tickAll(source){
	var id = $(source).attr('id');
	if(source.checked){
		$('.act_'+ id).prop('checked',true);
	}else{
		$('.act_'+ id).prop('checked',false);
	}
}

</script>

</head>
<body style="font-family:Arial, Helvetica, sans-serif; line-height:20px;">
<form method = "post" action = "" enctype="multipart/form-data">

<h2>Unpaid Annual Leave Summary</h2>
	<?php foreach ($this->leaveList as $k => $v){?>
	<table border="1" cellspacing="0" cellpadding="5" style="font-size:13px;">
		<tr>
			<th>Name</th>
			<th>Leave Type</th>
			<th>Date</th>
			<th>Time</th>
			<th>Hour</th>
			<th>Pay Type</th>
			<th>Action</th>
			<th>Tick All<input type = "checkbox" id = "<?php echo $k;?>" onclick = "tickAll(this)"></input></th>
		</tr>
			<?php foreach ($v as $k2 => $v2){?>
		<tr>
			<td><?php echo $v2['first_name']." ".$v2['last_name']."(".$v2['ni'].")"?></td>
			<td><?php echo $v2['leave_type']?></td>
			<td><?php echo $v2['leave_date']?></td>
			<td><?php echo $v2['leave_time']?></td>
			<td><?php echo $v2['leave_hour']?></td>
			<td><?php echo $v2['pay_type']?></td>
			<td><input type = "checkbox" name = "leave[<?php echo $v2['id_leave']?>]" value = "1" class = "act_<?php echo $k?>"></input></td>
			<td>&nbsp;</td>
		</tr>
		<?php }?>
	</table>
	<br/>
	<br/>
	<?php }?>
<br/>
Paid Date:<input type = "text" name = "date" id = "date" ></input>
<input type = "submit" name = "submit" value = "Submit"></input>
</form>
</body>
</html>
